/*-------------------------------------------------------------------------
 *
 * pg_foreign_table.h
 *	  "外部表" 系统目录 (pg_foreign_table) 的定义
 *
 * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/catalog/pg_foreign_table.h
 *
 * NOTES
 *	  Catalog.pm 模块读取此文件并推导模式
 *	  信息。
 *
 *-------------------------------------------------------------------------
 */
#ifndef PG_FOREIGN_TABLE_H
#define PG_FOREIGN_TABLE_H

#include "catalog/genbki.h"
#include "catalog/pg_foreign_table_d.h"

/* ----------------
 *		pg_foreign_table 定义。 cpp 将其转换为
 *		typedef struct FormData_pg_foreign_table
 * ----------------
 */
CATALOG(pg_foreign_table,3118,ForeignTableRelationId)
{
	Oid			ftrelid BKI_LOOKUP(pg_class);	/* 外部表的 OID */
	Oid			ftserver BKI_LOOKUP(pg_foreign_server); /* 外部服务器的 OID */

#ifdef CATALOG_VARLEN			/* 可变长度字段从这里开始 */
	text		ftoptions[1];	/* FDW 特定选项 */
#endif
} FormData_pg_foreign_table;

/* ----------------
 *		Form_pg_foreign_table 对应于指向具有 pg_foreign_table 关系格式的元组的指针。
 * ----------------
 */
typedef FormData_pg_foreign_table *Form_pg_foreign_table;

DECLARE_TOAST(pg_foreign_table, 4153, 4154);

DECLARE_UNIQUE_INDEX_PKEY(pg_foreign_table_relid_index, 3119, ForeignTableRelidIndexId, on pg_foreign_table using btree(ftrelid oid_ops));

#endif							/* PG_FOREIGN_TABLE_H */
